package com.cr.admin.business.vip.service.impl;

import com.cr.admin.business.vip.dao.repository.VipRepository;
import com.cr.admin.business.vip.pojo.dto.VipAddParam;
import com.cr.admin.business.vip.pojo.dto.VipPasswordParam;
import com.cr.admin.business.vip.pojo.dto.VipQuery;
import com.cr.admin.business.vip.pojo.dto.VipUpdateParam;
import com.cr.admin.business.vip.pojo.entity.Vip;
import com.cr.admin.business.vip.pojo.vo.VipDetailVO;
import com.cr.admin.business.vip.service.VipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class VipServiceImpl implements VipService {
    @Autowired
    private VipRepository vipRepository;


    @Override
    public List<Vip> list(VipQuery vipQuery) {

        return vipRepository.selectList(vipQuery);
    }

    @Override
    public void insert(VipAddParam vipAddParam) {
        vipRepository.insert(vipAddParam);
    }

    @Override
    public void updateById(VipUpdateParam vipUpdateParam) {
        vipRepository.updateById(vipUpdateParam);
    }

    @Override
    public Vip selectById(Long id) {
        return vipRepository.selectById(id);
    }

    @Override
    public void deleteByIds(List<Long> ids) {
        vipRepository.deleteByIds(ids);
    }

    @Override
    public void resetPassword(Long id) {
        vipRepository.resetPassword(id);
    }

    @Override
    public void updateStatus(Long id, Integer status) {
        vipRepository.updateStatus(id,status);
    }

}
